<fieldset class="config-authentication-form">
  <div class="crayons-field">
    <%= admin_config_label :"#{provider.provider_name}_key" %>
    <p class="crayons-field__description">
      <%= Constants::Settings::Authentication.details[:"#{provider.provider_name}_key"][:description] %>
    </p>
    <%= f.text_field :"#{provider.provider_name}_key",
                     class: "crayons-textfield",
                     value: Settings::Authentication.public_send("#{provider.provider_name}_key"),
                     placeholder: Constants::Settings::Authentication.details[:"#{provider.provider_name}_key"][:placeholder] %>
  </div>
  <div class="crayons-field">
    <%= admin_config_label :"#{provider.provider_name}_secret" %>
    <p class="crayons-field__description">
      <%= Constants::Settings::Authentication.details[:"#{provider.provider_name}_secret"][:description] %>
    <p>
    <%= f.text_field :"#{provider.provider_name}_secret",
                     class: "crayons-textfield",
                     value: Settings::Authentication.public_send("#{provider.provider_name}_secret"),
                     placeholder: Constants::Settings::Authentication.details[:"#{provider.provider_name}_secret"][:placeholder] %>
  </div>
  <div class="crayons-btn-actions">
    <% if provider.provider_name == :forem && !authentication_provider_enabled?(provider) %>
      <div class="crayons-field">
        <a href="https://developers.forem.com/backend/auth-forem" class="crayons-btn" target="_blank">
          Get started here
        </a>
      </div>
    <% end %>
    <% if authentication_provider_enabled?(provider) %>
      <button
        class="crayons-btn crayons-btn--danger"
        data-action="click->config#activateAuthProviderModal"
        data-tooltip="<%= tooltip_text_email_or_auth_provider_btns %>"
        data-provider-name="<%= provider.provider_name %>"
        data-provider-official-name="<%= provider.official_name %>"
        <%= disabled_attr_on_auth_provider_enable_btn %>>
        Disable
      </button>
      <button
        class="crayons-btn crayons-btn--secondary"
        data-provider-name="<%= provider.provider_name %>"
        data-action="click->config#hideAuthProviderSettings">
        Close
      </button>
    <% else %>
      <button
        class="crayons-btn crayons-btn--secondary"
        data-provider-name="<%= provider.provider_name %>"
        data-action="click->config#disableAuthProvider">
        Undo
      </button>
    <% end %>
  </div>
</fieldset>
